package com.example.spring.domain;

import lombok.Data;

/**
 * 
 * @TableName inventory
 */
@Data
public class Inventory {
    /**
     * 
     */
    private Integer 序号;

    /**
     * 商品名称
     */
    private String product_name;

    /**
     * 当前结存数量
     */
    private Integer inventory_quantity;

    /**
     * 库存阈值, 低于阈值需要补充
     */
    private Integer inventory_threshold;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Inventory other = (Inventory) that;
        return (this.get序号() == null ? other.get序号() == null : this.get序号().equals(other.get序号()))
            && (this.getProduct_name() == null ? other.getProduct_name() == null : this.getProduct_name().equals(other.getProduct_name()))
            && (this.getInventory_quantity() == null ? other.getInventory_quantity() == null : this.getInventory_quantity().equals(other.getInventory_quantity()))
            && (this.getInventory_threshold() == null ? other.getInventory_threshold() == null : this.getInventory_threshold().equals(other.getInventory_threshold()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((get序号() == null) ? 0 : get序号().hashCode());
        result = prime * result + ((getProduct_name() == null) ? 0 : getProduct_name().hashCode());
        result = prime * result + ((getInventory_quantity() == null) ? 0 : getInventory_quantity().hashCode());
        result = prime * result + ((getInventory_threshold() == null) ? 0 : getInventory_threshold().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", 序号=").append(序号);
        sb.append(", product_name=").append(product_name);
        sb.append(", inventory_quantity=").append(inventory_quantity);
        sb.append(", inventory_threshold=").append(inventory_threshold);
        sb.append("]");
        return sb.toString();
    }
}